Cache
JS/TS-friendly facade over com.sorinirmies.arrow.resiliencekit.Cache, specialized to string keys (the common case for JS/TS caches) to keep this facade's generics simple.
import { Cache } from "arrow-resilience-kit";
const cache = await Cache.create<User>({ maxSize: 1000, ttlMillis: 300_000 });
const user = await cache.getOrPut("user-123", () => userService.fetch("user-123"));Content copied to clipboard
Functions
Link copied to clipboard
Whether key is currently present (and not expired).
Link copied to clipboard
Resets statistics counters (not the cache's contents).
Link copied to clipboard
Current statistics snapshot.